<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: tic_tac_toe Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">tic_tac_toe Namespace Reference<div class="ingroups"><a class="el" href="group__examplecontract.html">Example Storage</a> &raquo; <a class="el" href="group__tictactoecontract.html">Tic Tac Toe Contract</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtic__tac__toe_1_1close.html">close</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Action to close new game.  <a href="structtic__tac__toe_1_1close.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtic__tac__toe_1_1create.html">create</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Action to create new game.  <a href="structtic__tac__toe_1_1create.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtic__tac__toe_1_1move.html">move</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Action to make movement.  <a href="structtic__tac__toe_1_1move.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtic__tac__toe_1_1movement.html">movement</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Data structure for movement.  <a href="structtic__tac__toe_1_1movement.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtic__tac__toe_1_1restart.html">restart</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Action to restart new game.  <a href="structtic__tac__toe_1_1restart.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a3455767150132ad7ccdfe8c0e5a71989"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#a3455767150132ad7ccdfe8c0e5a71989">Games</a> = <a class="el" href="structeosio_1_1table.html">eosio::table</a>&lt; <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(tic.tac.toe), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(tic.tac.toe), <a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(games), game, <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> &gt;</td></tr>
<tr class="memdesc:a3455767150132ad7ccdfe8c0e5a71989"><td class="mdescLeft">&#160;</td><td class="mdescRight">table to store list of games  <a href="#a3455767150132ad7ccdfe8c0e5a71989">More...</a><br /></td></tr>
<tr class="separator:a3455767150132ad7ccdfe8c0e5a71989"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a6f32b76cb96a584daeacd2fd81de47d2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#a6f32b76cb96a584daeacd2fd81de47d2">is_empty_cell</a> (const <a class="el" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> &amp;cell)</td></tr>
<tr class="memdesc:a6f32b76cb96a584daeacd2fd81de47d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if cell is empty.  <a href="#a6f32b76cb96a584daeacd2fd81de47d2">More...</a><br /></td></tr>
<tr class="separator:a6f32b76cb96a584daeacd2fd81de47d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb2ba327b8a040528d6b773f72712b28"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#abb2ba327b8a040528d6b773f72712b28">is_valid_movement</a> (const <a class="el" href="structtic__tac__toe_1_1movement.html">movement</a> &amp;mvt, const game &amp;game_for_movement)</td></tr>
<tr class="memdesc:abb2ba327b8a040528d6b773f72712b28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check for valid movement  Movement is considered valid if it is inside the board and done on empty cell.  <a href="#abb2ba327b8a040528d6b773f72712b28">More...</a><br /></td></tr>
<tr class="separator:abb2ba327b8a040528d6b773f72712b28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87364eb508987ae99315cb550318a2cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#a87364eb508987ae99315cb550318a2cd">get_winner</a> (const game &amp;current_game)</td></tr>
<tr class="memdesc:a87364eb508987ae99315cb550318a2cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get winner of the game  Winner of the game is the first player who made three consecutive aligned movement.  <a href="#a87364eb508987ae99315cb550318a2cd">More...</a><br /></td></tr>
<tr class="separator:a87364eb508987ae99315cb550318a2cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a1cf506a98d2d47fa5beecf5f4fc5df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#a2a1cf506a98d2d47fa5beecf5f4fc5df">apply_create</a> (const <a class="el" href="structtic__tac__toe_1_1create.html">create</a> &amp;c)</td></tr>
<tr class="memdesc:a2a1cf506a98d2d47fa5beecf5f4fc5df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Apply create action.  <a href="#a2a1cf506a98d2d47fa5beecf5f4fc5df">More...</a><br /></td></tr>
<tr class="separator:a2a1cf506a98d2d47fa5beecf5f4fc5df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3aab36c5e82f82de8f84052cff22e2a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#a3aab36c5e82f82de8f84052cff22e2a4">apply_restart</a> (const <a class="el" href="structtic__tac__toe_1_1restart.html">restart</a> &amp;r)</td></tr>
<tr class="memdesc:a3aab36c5e82f82de8f84052cff22e2a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Apply restart action.  <a href="#a3aab36c5e82f82de8f84052cff22e2a4">More...</a><br /></td></tr>
<tr class="separator:a3aab36c5e82f82de8f84052cff22e2a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71654d11099ad786f398b81cbb49b516"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#a71654d11099ad786f398b81cbb49b516">apply_close</a> (const <a class="el" href="structtic__tac__toe_1_1close.html">close</a> &amp;c)</td></tr>
<tr class="memdesc:a71654d11099ad786f398b81cbb49b516"><td class="mdescLeft">&#160;</td><td class="mdescRight">Apply close action.  <a href="#a71654d11099ad786f398b81cbb49b516">More...</a><br /></td></tr>
<tr class="separator:a71654d11099ad786f398b81cbb49b516"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e150e574fbbc4aa01f6d904777fff09"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#a7e150e574fbbc4aa01f6d904777fff09">apply_move</a> (const <a class="el" href="structtic__tac__toe_1_1move.html">move</a> &amp;m)</td></tr>
<tr class="memdesc:a7e150e574fbbc4aa01f6d904777fff09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Apply move action.  <a href="#a7e150e574fbbc4aa01f6d904777fff09">More...</a><br /></td></tr>
<tr class="separator:a7e150e574fbbc4aa01f6d904777fff09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af55e2c47d79222b468915e5b41487f6a"><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetic__tac__toe.html#af55e2c47d79222b468915e5b41487f6a">PACKED</a> (game)</td></tr>
<tr class="memdesc:af55e2c47d79222b468915e5b41487f6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Data structure to hold game information.  <a href="#af55e2c47d79222b468915e5b41487f6a">More...</a><br /></td></tr>
<tr class="separator:af55e2c47d79222b468915e5b41487f6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a3455767150132ad7ccdfe8c0e5a71989"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3455767150132ad7ccdfe8c0e5a71989">&#9670;&nbsp;</a></span>Games</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="namespacetic__tac__toe.html#a3455767150132ad7ccdfe8c0e5a71989">tic_tac_toe::Games</a> = typedef <a class="el" href="structeosio_1_1table.html">eosio::table</a>&lt;<a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(tic.tac.toe),<a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(tic.tac.toe),<a class="el" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(games),game,<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a71654d11099ad786f398b81cbb49b516"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71654d11099ad786f398b81cbb49b516">&#9670;&nbsp;</a></span>apply_close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tic_tac_toe::apply_close </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structtic__tac__toe_1_1close.html">close</a> &amp;&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">close</td><td>- action to be applied </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a2a1cf506a98d2d47fa5beecf5f4fc5df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a1cf506a98d2d47fa5beecf5f4fc5df">&#9670;&nbsp;</a></span>apply_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tic_tac_toe::apply_create </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structtic__tac__toe_1_1create.html">create</a> &amp;&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">create</td><td>- action to be applied </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7e150e574fbbc4aa01f6d904777fff09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e150e574fbbc4aa01f6d904777fff09">&#9670;&nbsp;</a></span>apply_move()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tic_tac_toe::apply_move </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structtic__tac__toe_1_1move.html">move</a> &amp;&#160;</td>
          <td class="paramname"><em>m</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">move</td><td>- action to be applied </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3aab36c5e82f82de8f84052cff22e2a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3aab36c5e82f82de8f84052cff22e2a4">&#9670;&nbsp;</a></span>apply_restart()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tic_tac_toe::apply_restart </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structtic__tac__toe_1_1restart.html">restart</a> &amp;&#160;</td>
          <td class="paramname"><em>r</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">restart</td><td>- action to be applied </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a87364eb508987ae99315cb550318a2cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87364eb508987ae99315cb550318a2cd">&#9670;&nbsp;</a></span>get_winner()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> tic_tac_toe::get_winner </td>
          <td>(</td>
          <td class="paramtype">const game &amp;&#160;</td>
          <td class="paramname"><em>current_game</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">game</td><td>- the game which we want to determine the winner of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>winner of the game (can be either none/ draw/ account name of host/ account name of challenger) </dd></dl>

</div>
</div>
<a id="a6f32b76cb96a584daeacd2fd81de47d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6f32b76cb96a584daeacd2fd81de47d2">&#9670;&nbsp;</a></span>is_empty_cell()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool tic_tac_toe::is_empty_cell </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> &amp;&#160;</td>
          <td class="paramname"><em>cell</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cell</td><td>- value of the cell (should be either 0, 1, or 2) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if cell is empty </dd></dl>

</div>
</div>
<a id="abb2ba327b8a040528d6b773f72712b28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb2ba327b8a040528d6b773f72712b28">&#9670;&nbsp;</a></span>is_valid_movement()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool tic_tac_toe::is_valid_movement </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structtic__tac__toe_1_1movement.html">movement</a> &amp;&#160;</td>
          <td class="paramname"><em>mvt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const game &amp;&#160;</td>
          <td class="paramname"><em>game_for_movement</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">movement</td><td>- the movement made by the player </td></tr>
    <tr><td class="paramname">game</td><td>- the game on which the movement is being made </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if movement is valid </dd></dl>

</div>
</div>
<a id="af55e2c47d79222b468915e5b41487f6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af55e2c47d79222b468915e5b41487f6a">&#9670;&nbsp;</a></span>PACKED()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct tic_tac_toe::PACKED </td>
          <td>(</td>
          <td class="paramtype">game&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
